<?php

declare(strict_types=1);

namespace App\Request\Web;

use Hyperf\Validation\Request\FormRequest;

class SignInRequest extends FormRequest
{

    public function authorize(): bool
    {
        return true;
    }
    protected $scenes = [
        'month_sign_num' => ['month']
    ];
    public function rules(): array
    {
        return [
            'month' => [
                'required',
                'string',
                'regex:/^\d{6}$/',
            ]
        ];
    }

    public function messages(): array
    {
        return [
            'month.required' => '签到月份不能为空',
            'month.regex' => '签到月份格式错误'
        ];
    }

    public function attributes(): array
    {
        return [
            'month' => '签到月份'
        ];
    }
}
